
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>小破孩推箱子</title>
<style type="text/css">
*{ margin:0;padding:0;}
body{background:url(../jsGames/images/za.gif); font-family:"Arial Rounded MT Bold";font-size: 12px;}
#wrap{ position:relative; margin:0 auto;}
#game{}
#game li{ width:40px; height: 40px; float: left; list-style:none;background:url(../jsGames/images/lu.gif) no-repeat;}
#boss{width: 40px;height:40px; background:url(../jsGames/images/rboss.gif) no-repeat; position:absolute; left:0; top:0;z-index: 10;}
#game .barrier{background:url(../jsGames/images/za.gif) no-repeat;}
.box{width: 40px;height:40px; background:url(../jsGames/images/box.png) no-repeat; position:absolute; z-index: 10;}
#wrap .r{background:url(../jsGames/images/rboss.gif) no-repeat;}
#wrap .l{background:url(../jsGames/images/lboss.gif) no-repeat;}
.target{width: 40px;height:40px;position:absolute;background:url(../jsGames/images/target.gif) no-repeat;}
#control{height:40px; text-align: center;}
#control a,#control span{ display:inline-block; margin: 8px 3px; padding:2px 4px; background:#468555; color:#fff; text-decoration: none;}
#control a:hover{background:#499555;}
#control .active{background:#96ca00;}
#control .active:hover{background:#96ca00;}
</style>
<script type="text/javascript" src="map.js"></script>
<script type="text/javascript" src="../jsGames/game.js"></script>
</head>
<body>

<div id="control">
	<a href="javascript:;">上一关</a>
	<a href="javascript:;">下一关</a>
	<a href="javascript:;">重玩</a>
	<span>第1关</span>
	<a href="javascript:;">存储关卡</a>
	<a href="javascript:;">不存储关卡</a>
</div>
<div id="wrap">
</div>
<script type="text/javascript">
var control = document.getElementById("control").getElementsByTagName("a");
var guan = document.getElementById("control").getElementsByTagName("span")[0];
if(getStorage("check")=="true"){
	control[3].className = "active";
	control[4].className = "";
	level=getStorage("level"),iNow=getStorage("iNow");
}else{
	control[4].className = "active";
	control[3].className = "";
	level=0,iNow=0;
}
guan.innerHTML = "第"+(parseInt(level)+1)+"关";
CreatGame(level);
addEvent(control[0],"click",function(){
	level = level==0?0:--level;
	setStorage("level",level);
	guan.innerHTML = "第"+(level+1)+"关";
	CreatGame(level);
})
addEvent(control[1],"click",next);
addEvent(control[2],"click",function(){
	CreatGame(level);
});
addEvent(control[3],"click",function(){
	setStorage("check",true);
	setStorage("level",level);
	setStorage("iNow",iNow);
	control[3].className = "active";
	control[4].className = "";
});
addEvent(control[4],"click",function(){
	if(window.confirm("确认不记录记录关卡？ 确定后刷新浏览器将从第一关开始！")){
		setStorage("check",false);
		control[4].className = "active";
		control[3].className = "";
	}
});
</script>
</body>
</html>
